<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Agile Modbus: RTU Private Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Agile Modbus
   &#160;<span id="projectnumber">1.1.4</span>
   </div>
   <div id="projectbrief">Lightweight modbus protocol stack.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group___r_t_u___private___functions.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">RTU Private Functions<div class="ingroups"><a class="el" href="group___r_t_u.html">RTU</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Collaboration diagram for RTU Private Functions:</div>
<div class="dyncontent">
<div class="center"><img src="group___r_t_u___private___functions.png" border="0" usemap="#agroup______r__t__u______private______functions" alt=""/></div>
<map name="agroup______r__t__u______private______functions" id="agroup______r__t__u______private______functions">
<area shape="rect" title=" " alt="" coords="101,5,265,31"/>
<area shape="rect" href="group___r_t_u.html" title=" " alt="" coords="5,5,53,31"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga917aedd343bdcfd4d4a7b9fc80db2a17"><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga917aedd343bdcfd4d4a7b9fc80db2a17">agile_modbus_rtu_crc16</a> (uint8_t *buffer, uint16_t buffer_length)</td></tr>
<tr class="memdesc:ga917aedd343bdcfd4d4a7b9fc80db2a17"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU CRC16 calculation.  <a href="group___r_t_u___private___functions.html#ga917aedd343bdcfd4d4a7b9fc80db2a17">More...</a><br /></td></tr>
<tr class="separator:ga917aedd343bdcfd4d4a7b9fc80db2a17"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga904257d5d6c88f9f81447bc0accf9b62"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga904257d5d6c88f9f81447bc0accf9b62">agile_modbus_rtu_set_slave</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *ctx, int slave)</td></tr>
<tr class="memdesc:ga904257d5d6c88f9f81447bc0accf9b62"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU sets the address interface.  <a href="group___r_t_u___private___functions.html#ga904257d5d6c88f9f81447bc0accf9b62">More...</a><br /></td></tr>
<tr class="separator:ga904257d5d6c88f9f81447bc0accf9b62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga604461d9c9522b5352ceda519eeae006"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga604461d9c9522b5352ceda519eeae006">agile_modbus_rtu_build_request_basis</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *ctx, int function, int addr, int nb, uint8_t *req)</td></tr>
<tr class="memdesc:ga604461d9c9522b5352ceda519eeae006"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU builds the basic request message interface (header message)  <a href="group___r_t_u___private___functions.html#ga604461d9c9522b5352ceda519eeae006">More...</a><br /></td></tr>
<tr class="separator:ga604461d9c9522b5352ceda519eeae006"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0bbede450717d31223094f8e795e0e89"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga0bbede450717d31223094f8e795e0e89">agile_modbus_rtu_build_response_basis</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gaa551bce4815f2889224102ac08f779ad">agile_modbus_sft_t</a> *sft, uint8_t *rsp)</td></tr>
<tr class="memdesc:ga0bbede450717d31223094f8e795e0e89"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU builds the basic response message interface (header message)  <a href="group___r_t_u___private___functions.html#ga0bbede450717d31223094f8e795e0e89">More...</a><br /></td></tr>
<tr class="separator:ga0bbede450717d31223094f8e795e0e89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacd396678c9cc5a5c77cba6615eb212bd"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#gacd396678c9cc5a5c77cba6615eb212bd">agile_modbus_rtu_prepare_response_tid</a> (const uint8_t *req, int *req_length)</td></tr>
<tr class="memdesc:gacd396678c9cc5a5c77cba6615eb212bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU ready response interface.  <a href="group___r_t_u___private___functions.html#gacd396678c9cc5a5c77cba6615eb212bd">More...</a><br /></td></tr>
<tr class="separator:gacd396678c9cc5a5c77cba6615eb212bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1cb91eb00f06868c4c5b85e67f7ef126"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#ga1cb91eb00f06868c4c5b85e67f7ef126">agile_modbus_rtu_send_msg_pre</a> (uint8_t *req, int req_length)</td></tr>
<tr class="memdesc:ga1cb91eb00f06868c4c5b85e67f7ef126"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU pre-send data interface.  <a href="group___r_t_u___private___functions.html#ga1cb91eb00f06868c4c5b85e67f7ef126">More...</a><br /></td></tr>
<tr class="separator:ga1cb91eb00f06868c4c5b85e67f7ef126"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa7ff9945c4910eafae9b737957ae6cad"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#gaa7ff9945c4910eafae9b737957ae6cad">agile_modbus_rtu_check_integrity</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *ctx, uint8_t *msg, const int msg_length)</td></tr>
<tr class="memdesc:gaa7ff9945c4910eafae9b737957ae6cad"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU check received data integrity interface (CRC16 comparison)  <a href="group___r_t_u___private___functions.html#gaa7ff9945c4910eafae9b737957ae6cad">More...</a><br /></td></tr>
<tr class="separator:gaa7ff9945c4910eafae9b737957ae6cad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabc4beee96e865a624d3d8129633c8765"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___r_t_u___private___functions.html#gabc4beee96e865a624d3d8129633c8765">agile_modbus_rtu_pre_check_confirmation</a> (<a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *ctx, const uint8_t *req, const uint8_t *rsp, int rsp_length)</td></tr>
<tr class="memdesc:gabc4beee96e865a624d3d8129633c8765"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTU pre-check confirmation interface (request response address comparison)  <a href="group___r_t_u___private___functions.html#gabc4beee96e865a624d3d8129633c8765">More...</a><br /></td></tr>
<tr class="separator:gabc4beee96e865a624d3d8129633c8765"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga917aedd343bdcfd4d4a7b9fc80db2a17"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga917aedd343bdcfd4d4a7b9fc80db2a17">&#9670;&nbsp;</a></span>agile_modbus_rtu_crc16()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint16_t agile_modbus_rtu_crc16 </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>buffer_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>RTU CRC16 calculation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>data pointer </td></tr>
    <tr><td class="paramname">buffer_length</td><td>data length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CRC16 value </dd></dl>

<p class="definition">Definition at line <a class="el" href="agile__modbus__rtu_8c_source.html#l00100">100</a> of file <a class="el" href="agile__modbus__rtu_8c_source.html">agile_modbus_rtu.c</a>.</p>
<div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___r_t_u___private___functions_ga917aedd343bdcfd4d4a7b9fc80db2a17_icgraph.png" border="0" usemap="#agroup___r_t_u___private___functions_ga917aedd343bdcfd4d4a7b9fc80db2a17_icgraph" alt=""/></div>
<map name="agroup___r_t_u___private___functions_ga917aedd343bdcfd4d4a7b9fc80db2a17_icgraph" id="agroup___r_t_u___private___functions_ga917aedd343bdcfd4d4a7b9fc80db2a17_icgraph">
<area shape="rect" title="RTU CRC16 calculation." alt="" coords="236,46,416,73"/>
<area shape="rect" href="group___r_t_u___private___functions.html#gaa7ff9945c4910eafae9b737957ae6cad" title="RTU check received data integrity interface (CRC16 comparison)" alt="" coords="5,5,188,47"/>
<area shape="rect" href="group___r_t_u___private___functions.html#ga1cb91eb00f06868c4c5b85e67f7ef126" title="RTU pre&#45;send data interface." alt="" coords="9,71,185,112"/>
</map>
</div>

</div>
</div>
<a id="ga904257d5d6c88f9f81447bc0accf9b62"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga904257d5d6c88f9f81447bc0accf9b62">&#9670;&nbsp;</a></span>agile_modbus_rtu_set_slave()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int agile_modbus_rtu_set_slave </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>slave</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>RTU sets the address interface. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>modbus handle </td></tr>
    <tr><td class="paramname">slave</td><td>slave address </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0: success </dd></dl>

<p class="definition">Definition at line <a class="el" href="agile__modbus__rtu_8c_source.html#l00122">122</a> of file <a class="el" href="agile__modbus__rtu_8c_source.html">agile_modbus_rtu.c</a>.</p>

</div>
</div>
<a id="ga604461d9c9522b5352ceda519eeae006"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga604461d9c9522b5352ceda519eeae006">&#9670;&nbsp;</a></span>agile_modbus_rtu_build_request_basis()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int agile_modbus_rtu_build_request_basis </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>nb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>req</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>RTU builds the basic request message interface (header message) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>modbus handle </td></tr>
    <tr><td class="paramname">function</td><td>function code </td></tr>
    <tr><td class="paramname">addr</td><td>register address </td></tr>
    <tr><td class="paramname">nb</td><td>number of registers </td></tr>
    <tr><td class="paramname">req</td><td>data storage pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>data length </dd></dl>

<p class="definition">Definition at line <a class="el" href="agile__modbus__rtu_8c_source.html#l00137">137</a> of file <a class="el" href="agile__modbus__rtu_8c_source.html">agile_modbus_rtu.c</a>.</p>

</div>
</div>
<a id="ga0bbede450717d31223094f8e795e0e89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0bbede450717d31223094f8e795e0e89">&#9670;&nbsp;</a></span>agile_modbus_rtu_build_response_basis()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int agile_modbus_rtu_build_response_basis </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___c_o_m_m_o_n___exported___types.html#gaa551bce4815f2889224102ac08f779ad">agile_modbus_sft_t</a> *&#160;</td>
          <td class="paramname"><em>sft</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>rsp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>RTU builds the basic response message interface (header message) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sft</td><td>modbus header parameter structure pointer </td></tr>
    <tr><td class="paramname">rsp</td><td>data storage pointer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>data length </dd></dl>

<p class="definition">Definition at line <a class="el" href="agile__modbus__rtu_8c_source.html#l00157">157</a> of file <a class="el" href="agile__modbus__rtu_8c_source.html">agile_modbus_rtu.c</a>.</p>

</div>
</div>
<a id="gacd396678c9cc5a5c77cba6615eb212bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacd396678c9cc5a5c77cba6615eb212bd">&#9670;&nbsp;</a></span>agile_modbus_rtu_prepare_response_tid()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int agile_modbus_rtu_prepare_response_tid </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>req_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>RTU ready response interface. </p>
<dl class="section note"><dt>Note</dt><dd>This API will automatically subtract the AGILE_MODBUS_RTU_CHECKSUM_LENGTH length from req_length </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>request data pointer </td></tr>
    <tr><td class="paramname">req_length</td><td>request data length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 (RTU has no transaction identifier) </dd></dl>

<p class="definition">Definition at line <a class="el" href="agile__modbus__rtu_8c_source.html#l00172">172</a> of file <a class="el" href="agile__modbus__rtu_8c_source.html">agile_modbus_rtu.c</a>.</p>

</div>
</div>
<a id="ga1cb91eb00f06868c4c5b85e67f7ef126"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1cb91eb00f06868c4c5b85e67f7ef126">&#9670;&nbsp;</a></span>agile_modbus_rtu_send_msg_pre()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int agile_modbus_rtu_send_msg_pre </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>req_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>RTU pre-send data interface. </p>
<dl class="section note"><dt>Note</dt><dd>This API will calculate CRC16 and automatically fill in the tail </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">req</td><td>data storage pointer </td></tr>
    <tr><td class="paramname">req_length</td><td>existing data length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>data length </dd></dl>

<p class="definition">Definition at line <a class="el" href="agile__modbus__rtu_8c_source.html#l00187">187</a> of file <a class="el" href="agile__modbus__rtu_8c_source.html">agile_modbus_rtu.c</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___r_t_u___private___functions_ga1cb91eb00f06868c4c5b85e67f7ef126_cgraph.png" border="0" usemap="#agroup___r_t_u___private___functions_ga1cb91eb00f06868c4c5b85e67f7ef126_cgraph" alt=""/></div>
<map name="agroup___r_t_u___private___functions_ga1cb91eb00f06868c4c5b85e67f7ef126_cgraph" id="agroup___r_t_u___private___functions_ga1cb91eb00f06868c4c5b85e67f7ef126_cgraph">
<area shape="rect" title="RTU pre&#45;send data interface." alt="" coords="5,5,181,47"/>
<area shape="rect" href="group___r_t_u___private___functions.html#ga917aedd343bdcfd4d4a7b9fc80db2a17" title="RTU CRC16 calculation." alt="" coords="229,13,409,39"/>
</map>
</div>

</div>
</div>
<a id="gaa7ff9945c4910eafae9b737957ae6cad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa7ff9945c4910eafae9b737957ae6cad">&#9670;&nbsp;</a></span>agile_modbus_rtu_check_integrity()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int agile_modbus_rtu_check_integrity </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>msg_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>RTU check received data integrity interface (CRC16 comparison) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>modbus handle </td></tr>
    <tr><td class="paramname">msg</td><td>Receive data pointer </td></tr>
    <tr><td class="paramname">msg_length</td><td>valid data length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>&gt;0: valid data length; others: exception </dd></dl>

<p class="definition">Definition at line <a class="el" href="agile__modbus__rtu_8c_source.html#l00203">203</a> of file <a class="el" href="agile__modbus__rtu_8c_source.html">agile_modbus_rtu.c</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___r_t_u___private___functions_gaa7ff9945c4910eafae9b737957ae6cad_cgraph.png" border="0" usemap="#agroup___r_t_u___private___functions_gaa7ff9945c4910eafae9b737957ae6cad_cgraph" alt=""/></div>
<map name="agroup___r_t_u___private___functions_gaa7ff9945c4910eafae9b737957ae6cad_cgraph" id="agroup___r_t_u___private___functions_gaa7ff9945c4910eafae9b737957ae6cad_cgraph">
<area shape="rect" title="RTU check received data integrity interface (CRC16 comparison)" alt="" coords="5,5,188,47"/>
<area shape="rect" href="group___r_t_u___private___functions.html#ga917aedd343bdcfd4d4a7b9fc80db2a17" title="RTU CRC16 calculation." alt="" coords="236,13,416,39"/>
</map>
</div>

</div>
</div>
<a id="gabc4beee96e865a624d3d8129633c8765"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabc4beee96e865a624d3d8129633c8765">&#9670;&nbsp;</a></span>agile_modbus_rtu_pre_check_confirmation()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int agile_modbus_rtu_pre_check_confirmation </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___c_o_m_m_o_n___exported___types.html#gad07c76f52ecac865589bdea79112ccb6">agile_modbus_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>rsp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rsp_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>RTU pre-check confirmation interface (request response address comparison) </p>
<dl class="section note"><dt>Note</dt><dd>If the request address is broadcast address 0, return success </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>modbus handle </td></tr>
    <tr><td class="paramname">req</td><td>request data pointer </td></tr>
    <tr><td class="paramname">rsp</td><td>response data pointer </td></tr>
    <tr><td class="paramname">rsp_length</td><td>response data length </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0: success; others: exception </dd></dl>

<p class="definition">Definition at line <a class="el" href="agile__modbus__rtu_8c_source.html#l00227">227</a> of file <a class="el" href="agile__modbus__rtu_8c_source.html">agile_modbus_rtu.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
